Skip to main content
GET
/
v1
/
tasks
/
{task_id}
/
thread
/
full
Get Task'S Full Thread
curl --request GET \
  --url https://api.xpander.ai/v1/tasks/{task_id}/thread/full \
  --header 'x-api-key: <api-key>'
{
  "root": [
    {}
  ]
}
Retrieve the complete conversation thread for a task including all messages from the root task and all sub-tasks. This endpoint is particularly useful for debugging multi-agent workflows.

Path Parameters

task_id
string
required
Unique identifier of the task (UUID format)

Response

Returns a nested object containing conversation threads:
root
array
Array of messages from the root task
[sub_task_id]
array
For each sub-task, an array of messages with the same structure as root

Example Request

curl -X GET -H "x-api-key: YOUR_API_KEY" \
  https://api.xpander.ai/v1/tasks/60ce6693-9c4d-45a0-a675-76cd8cbefbac/thread/full

Example Response

{
  "root": [
    {
      "id": "ad8a9e63-e23c-41ec-9b6a-efb472d51fbc",
      "role": "user",
      "content": "What is 5+5?",
      "name": null,
      "tool_call_id": null,
      "tool_calls": null,
      "audio": null,
      "images": null,
      "videos": null,
      "files": null,
      "audio_output": null,
      "image_output": null,
      "video_output": null,
      "file_output": null,
      "redacted_reasoning_content": null,
      "provider_data": null,
      "citations": null,
      "reasoning_content": null,
      "tool_name": null,
      "tool_args": null,
      "tool_call_error": null,
      "stop_after_tool_call": false,
      "add_to_agent_memory": true,
      "from_history": false,
      "metrics": {
        "input_tokens": 0,
        "output_tokens": 0,
        "total_tokens": 0,
        "audio_input_tokens": 0,
        "audio_output_tokens": 0,
        "audio_total_tokens": 0,
        "cache_read_tokens": 0,
        "cache_write_tokens": 0,
        "reasoning_tokens": 0,
        "timer": null,
        "time_to_first_token": null,
        "duration": null,
        "provider_metrics": null,
        "additional_metrics": null
      },
      "references": null,
      "created_at": 1762463339
    },
    {
      "id": "9c4313f6-b8f0-48aa-9b5c-478ac60104aa",
      "role": "assistant",
      "content": "5 + 5 = 10",
      "name": null,
      "tool_call_id": null,
      "tool_calls": null,
      "audio": null,
      "images": null,
      "videos": null,
      "files": null,
      "audio_output": null,
      "image_output": null,
      "video_output": null,
      "file_output": null,
      "redacted_reasoning_content": null,
      "provider_data": null,
      "citations": null,
      "reasoning_content": null,
      "tool_name": null,
      "tool_args": null,
      "tool_call_error": null,
      "stop_after_tool_call": false,
      "add_to_agent_memory": true,
      "from_history": false,
      "metrics": {
        "input_tokens": 296,
        "output_tokens": 8,
        "total_tokens": 304,
        "audio_input_tokens": 0,
        "audio_output_tokens": 0,
        "audio_total_tokens": 0,
        "cache_read_tokens": 0,
        "cache_write_tokens": 0,
        "reasoning_tokens": 0,
        "timer": null,
        "time_to_first_token": null,
        "duration": null,
        "provider_metrics": null,
        "additional_metrics": null
      },
      "references": null,
      "created_at": 1762463339
    }
  ]
}

Use Cases

  • Debug multi-agent workflows - See the complete execution tree
  • Analyze token usage - Track token consumption across all sub-tasks
  • Audit conversations - Review complete interaction history
  • Performance analysis - Measure response times and token efficiency

Notes

  • This endpoint includes all sub-tasks spawned by the root task
  • Each sub-task has its own message array keyed by task ID
  • The root key always contains the main task’s conversation
  • Token metrics help track LLM API costs

Comparison with /thread Endpoint

Feature/thread/thread/full
Root task messages
Sub-task messages
Token metrics
Tool call details
Response structureSimple arrayNested object
Recommendation: Use /thread/full when you need to see sub-task execution details in multi-agent workflows.

See Also

  • [Get Task Thread](/API reference/v1/tasks/get-thread) - Get thread for root task only (currently has issues)
  • [Get Task](/API reference/v1/tasks/get-task) - Get task details and status
  • [List Tasks](/API reference/v1/tasks/list-tasks) - List all tasks

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

task_id
string
required

Response

Successful Response

root
object[]